import cv2

# cap = cv2.VideoCapture("rtsp://admin:HikYPKRCE@192.168.31.152:554//h264/ch1/main/av_stream")
cap = cv2.VideoCapture("rtsp://admin:mcns1234@192.168.31.252:10086/Streaming/Channels/101")
cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc('M', 'J', 'P', 'G'))
ret,frame = cap.read()
while ret:
    ret,frame = cap.read()
    frame = cv2.flip(frame,-1)
    cv2.imshow("frame",frame)
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break
cv2.destroyAllWindows()
cap.release()
